1452A Robot Program codeforces solution in cpp
by ujjal roy
#include<bits/stdc++.h>
using namespace std;
main()
{
int t,n,m;
cin>>t;
while(t--)
{
cin>>n>>m;
if(n==m) cout<<2*m<<endl;
else
{
int r=max(n,m);
cout<<2*r-1<<endl;
}
}
return 0;
}
1452A Robot Program codeforces solution in cpp
by ujjal roy
#include<bits/stdc++.h>
using namespace std;
main()
{
int t,n,m;
cin>>t;
while(t--)
{
cin>>n>>m;
if(n==m) cout<<2*m<<endl;
else
{
int r=max(n,m);
cout<<2*r-1<<endl;
}
}
return 0;
}
0 Comments